import os
from google.appengine.ext.webapp import template
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app

DEBUG = False

def isDebug():
  return os.environ.get('SERVER_SOFTWARE','').startswith('Development')

class MainPage(webapp.RequestHandler):
  def get(self):
    if isDebug():
      manifest = ''
    else:
      manifest = 'manifest="manifest"'

    template_values = {
      'manifestHtml': manifest,
    }

    path = os.path.join(os.path.dirname(__file__), 'index.html')
    self.response.out.write(template.render(path, template_values))

application = webapp.WSGIApplication([('/', MainPage)], debug=True)

def main():
  run_wsgi_app(application)

if __name__ == "__main__":
  main()
